package com.hifar.test.syncData.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hifar.model.BaseModel;
import com.hifar.plat.AopOption.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * @author zhuWeiWei
 * @description 同步表配置
 * @date 2025/4/11 11:43
 */
@ApiModel("数据同步表配置")
@Data
@TableName("hf_env_sync_table_config")
public class HfEnvSyncTableConfig extends BaseModel {

    @ApiModelProperty("表名称")
    @NotBlank(message = "表名称不能为空!")
    private String tableName;

    @ApiModelProperty("数据源")
    @NotBlank(message = "数据源不能为空!")
    private String dataSource;

    @ApiModelProperty(value = "表描述")
    private String description;

    /**
     * 同步策略
     */
    @ApiModelProperty(value = "同步策略")
    @Dict(dictCode = "sync_data_strategy")
    @NotBlank(message = "同步策略不能为空!")
    private String strategy;

    @ApiModelProperty("是否启用 1:是 2:否")
    @NotBlank(message = "是否启用不能为空!")
    private String enable;


    @ApiModelProperty("是否附件表 1:是 2:否")
    @NotBlank(message = "是否附件表不能为空!")
    private String izFile;

    @ApiModelProperty("附件表字段,多个逗号分割")
    private String fileFields;

    @ApiModelProperty("附件桶前缀，为空默认public")
    private String bucketPre;

    @ApiModelProperty("最后同步时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastSyncTime;
}
